using MicroMsg.Storage;
using MicroMsg.UI.Page;
using MicroMsg.UI.UserContrl;
using System;
using System.Globalization;
using System.Windows.Data;
namespace MicroMsg.UI.Converter
{
	public class GroupToBackGroundBrushValueConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			object result = null;
			if (value is Group<Contact>)
			{
				Group<Contact> group = value as Group<Contact>;
				if (group != null && group.HasItems)
				{
					result = R.theme.COMMON_BRUSH;
				}
				else
				{
					result = R.theme.COMMON_GROUP_SELECTOR_BRUSH;
				}
			}
			else
			{
				if (value is SelectPhoneContryPage.Group<AreaCode>)
				{
					SelectPhoneContryPage.Group<AreaCode> group2 = value as SelectPhoneContryPage.Group<AreaCode>;
					if (group2 != null && group2.HasItems)
					{
						result = R.theme.COMMON_BRUSH;
					}
					else
					{
						result = R.theme.COMMON_GROUP_SELECTOR_BRUSH;
					}
				}
				else
				{
					if (value is SelectCountryPage.Group<string>)
					{
						SelectCountryPage.Group<string> group3 = value as SelectCountryPage.Group<string>;
						if (group3 != null && group3.HasItems)
						{
							result = R.theme.COMMON_BRUSH;
						}
						else
						{
							result = R.theme.COMMON_GROUP_SELECTOR_BRUSH;
						}
					}
					else
					{
						if (value is SelectStatePage.Group<string>)
						{
							SelectStatePage.Group<string> group4 = value as SelectStatePage.Group<string>;
							if (group4 != null && group4.HasItems)
							{
								result = R.theme.COMMON_BRUSH;
							}
							else
							{
								result = R.theme.COMMON_GROUP_SELECTOR_BRUSH;
							}
						}
					}
				}
			}
			return result;
		}
		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}
